package com.common.boot.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 异常状态信息
 * @author xuqq
 * @date 2020-09-09
 * @version v1.0
 */
@Getter
@AllArgsConstructor
public enum ExceptionStatus {
    CHECK_FAILED("1001", "验证失败"),
    CHECK_EXCEPTION("1002", "校验异常"),
    SERVICE_EXCEPTION("1100", "服务异常"),
    DATABASE_EXCEPTION("4001", "数据库异常"),
    VIOLATION_EXCEPTION("4003", "验证异常"),
    USER_ROLE_EXCEPTION("1001", "用户与角色关联异常"),
    USER_DEPARTMENT_EXCEPTION("1002", "用户与部门关联异常"),
    USER_CREATOR_EXCEPTION("1004", "创建用户异常"),
    USER_ID_EXCEPTION("1005", "用户ID为空"),
    USER_NAME_EXIST_EXCEPTION("1006", "用户名称已存在"),
    PASSWORD_CONFIRMPASSWORD_NOT_SAME_EXCEPTION("1007", "两次输入的密码不一致"),
    PASSWORD_NULL_EXCEPTION("1008", "密码为空"),
    USER_STATUS_NULL_EXCEPTION("1009", "用户状态为空"),
    GET_AUTHORIZATION_NULL_EXCEPTION("1011", "获取Authorization为空"),
    USER_IS_LOCKED("1012", "用户被锁定"),
    ROLE_EXIST_EXCEPTION("2001", "角色已存在"),
    ROLE_ID_NULL_EXCEPTION("2002", "角色id为空"),
    ROLE_NOT_EXIST_EXCEPTION("2003", "角色不存在"),
    MENU_EXIST_EXCEPTION("3001", "菜单已存在"),
    PARENT_MENU_NOT_EXIST_EXCEPTION("3002", "父级菜单不存在"),
    MENU_ID_NULL_EXCEPTION("3003", "菜单id为空"),
    MENU_NOT_EXIST_EXCEPTION("3004", "菜单不存在"),
    MENU_NAME_EXIST_EXCEPTION("3005", "菜单名字已存在"),
    PARENT_MENU_ID_NULL_EXCEPTION("3006", "父级菜单id为空"),
    DEPART_EXIST_EXCEPTION("5001", "部门已存在"),
    DEPART_ID_NULL_EXCEPTION("5002", "部门ID为空"),
    DEPART_NOT_EXIST_EXCEPTION("5003", "部门不存在"),
    PARENT_DEPART_NOT_EXIST_EXCEPTION("5004", "父级部门不存在"),
    PARENT_DEPART_ID_NULL_EXCEPTION("5005", "父级部门id为空"),
    DEPART_ABBREVIATION_NOT_EXIST_EXCEPTION("5006", "部门简称不存在"),
    QUESTION_TYPE_NOT_SUPPORT("7008", "问题类型不支持"),
    REPEAT_IMPORT("7009", "重复导入"),
    PAPER_RELEASED("7009", "已发布数剧不可删除,请重新选择!"),
    TIME_SETTING_ERROR("7010", "开始时间不能大于結束时间"),
    END_TIME_LESS_THAN_NOW_ERROR("7013", "結束时间不能小于当前时间"),
    POST_EXCEPTION("7011", "发布异常，开始时间之后不可以发布"),
    CANCEL_POST_EXCEPTION("7012", "取消发布异常，考试期间不可以取消发布"),
    SUCCEED_REQUEST_FAILED_RESULT("10000", "不是期望的结果功"),
    METHOD_PARAMETER_FORMAT_CONVERSION_EXCEPTION("10001", "方法参数转换异常"),
    BIND_EXCEPTION("10002", "参数校验导致的获取异常参数导致的异常"),
    USER_EXIST_EXCEPTION("10003", "用户已存在"),
    USER_NOT_EXIST_EXCEPTION("10004", "账号未配置,请联系管理员配置账号相关权限"),
    GET_USER_NULL_EXCEPTION("10005", "获取用户信息异常"),
    INTERFACE_AUTHORIZATION_ERROR("10006", "Authorization解析异常"),
    USER_ADD_EXCEPTION("10007", "用户新增时异常"),
    USER_DELETE_EXCEPTION("10008", "用户删除时异常"),
    USER_UPDATE_EXCEPTION("10009", "用户信息更新异常"),
    LOG_SAVE_EXCEPTION("10010", "日志保存失败"),
    ILLEGAL_REQUEST("10011", "非法请求"),
    RESOURCES_NOT_FOUND_EXCEPTION("10012", "资源未找到"),
    ROLE_PERMISSION_EXCEPTION("10013", "没有此接口的操作权限"),
    ROLE_NOT_IS_MANAGER("10014", "仅系统管理员有操作权限"),
    DICTIONARY_GROUP_EXIST_EXCEPTION("10015", "字典组已存在"),
    DICTIONARY_EXIST_EXCEPTION("10016", "字典已存在"),
    DICTIONARY_GROUP_NOT_EXIST_EXCEPTION("10017", "字典组不存在"),
    DICTIONARY_NOT_EXIST_EXCEPTION("10018", "字典不存在"),
    DICTIONARY_ADD_EXCEPTION("10019", "字典新增时异常"),
    DICTIONARY_UPDATE_EXCEPTION("10020", "字典更新时异常"),
    DICTIONARY_DELETE_EXCEPTION("10021", "字典删除时异常"),
    DICTIONARY_GROUP_ADD_EXCEPTION("10022", "字典新增时异常"),
    DICTIONARY_GROUP_UPDATE_EXCEPTION("10023", "字典更新时异常"),
    DICTIONARY_GROUP_DELETE_EXCEPTION("10024", "字典删除时异常"),
    PERMISSION_EXCEPTION("10025", "用户没有操作权限"),
    OBJECT_EXIST_EXCEPTION("10026", "对象已存在"),
    OBJECT_NOT_EXIST_EXCEPTION("10027", "关联对象不存在"),
    OBJECT_ADD_EXCEPTION("10028", "对象新增时异常"),
    OBJECT_UPDATE_EXCEPTION("10029", "对象更新时异常"),
    OBJECT_DELETE_EXCEPTION("10030", "对象删除时异常"),
    OBJECT_NAME_PARSE_EXCEPTION("10031", "对象名称为[名称.文件类型]格式"),
    OBJECT_LENGTH_LIMIT("10032", "图片上传数量达到设定阈值"),
    OBJECT_ASSOCIATE_EXIST_EXCEPTION("10033", "存在关联对象,请先处理关联对象后再操作"),
    FILE_TYPE_NOT_SUPPORT("10044","文件类型不支持"),
    DATA_STORAGE_SIZE_OVERRIDE("10045","文件存储空间超出1G"),
    DATE_OVERRIDE("10046","超出最大可执行时间"),
    JS_TYPE_EXCEPTION("10047","不允许传入js脚本"),
    VIDEO_TYPE_NOT_SUPPORT("10048","视频类型不支持"),
    VOICE_TYPE_NOT_SUPPORT("10049","音频类型不支持"),
    PICTURE_TYPE_NOT_SUPPORT("10050","图片类型不支持"),
    REDIS_EXCEPTION("10051", "redis异常"),
    USER_IS_LOGIN("10052", "用户已登录"),
    RELATION_RELEASED("10053", "有答题记录的试卷不可修改"),
    IP_IS_LOGIN("10054", "ip已绑定登录用户"),
    JWT_DATE_EXPIRE("10055", "jwt校验会话已失效"),
    JWT_SIGN_EXPIRE("10056", "jwt校验签名未通过"),
    JWT_USER_EXCEPTION("10057", "jwt解析token获取用户失败"),
    JWT_TOKEN_NOT_FOUND("10058", "请求头未放入身份令牌"),
    INVALID_REQUEST("040001", "无效请求"),
    INVALID_CLIENT("040002", "无效client_id"),
    INVALID_GRANT("040003", "无效授权"),
    INVALID_SCOPE("040004", "无效scope"),
    INVALID_TOKEN("040005", "会话超时！请重新登陆"),
    INSUFFICIENT_SCOPE("040010", "授权不足"),
    REDIRECT_URI_MISMATCH("040020", "redirect url不匹配"),
    ACCESS_DENIED("040030", "拒绝访问"),
    METHOD_NOT_ALLOWED("040040", "不支持该方法"),
    SERVER_ERROR("040050", "权限服务错误"),
    UNAUTHORIZED_CLIENT("040060", "未授权客户端"),
    UNAUTHORIZED("040061", "未授权"),
    UNSUPPORTED_RESPONSE_TYPE("040070", " 不支持的响应类型"),
    UNSUPPORTED_GRANT_TYPE("040071", "不支持的授权类型"),
    EXPIRED_TOKEN("040101", "会话失效！请重新登陆"),
    REMOTE_LOGIN("040102", "异地登陆！请重新登陆"),
    INVALID_NOT_TOKEN("040005", "越权访问！"),
    INVALID_REFERER_ERROR("040008", "跨站点请求伪造！"),
    INVALID_REFERER_LOGIN("040009", "未授权登陆"),
    INVALID_REFERER_USER("040011", "业务系统未授权,请添加授权！"),
    INVALID_REFERER_ORG("040012", "权限服务错误请联系管理员！"),
    USER_LOGIN_EXCEPTION("10057", "登录校验失败,请检查输入的账号和密码"),

    MANUFACTURE_ADD_EXCEPTION("12345789", "同一地区厂商不能重复"),

    INFO_FAIL("9527","数据信息提交失败"),


    /**
     * 未捕获异常
     */
    NO_DEFINED("19999", "服务异常");

    /**
     * 错误码
     */
    private final String code;
    /**
     * 错误信息
     */
    private final String msg;

}
